package com.javabasic2.Shootclient;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JPanel;

public class BoomImage {

	private Image img[];
	private int sizeX, sizeY;
	private int x, y;
	private int lifePoint = 0;
	private JPanel panel;
	private boolean life = true;

	public BoomImage(Image[] img, MainFrame frame) {
		init();
		this.panel = frame.getPanel();
		this.img = img;
	}
	public int getSizeX() {
		return sizeX;
	}
	public int getSizeY() {
		return sizeY;
	}
	public void setSize(int sizeX, int sizeY) {
		this.sizeX = sizeX;
		this.sizeY = sizeY;
	}
	public void setPos(int x, int y) {
		this.x = x;
		this.y = y;
	}
	public void init() {
	}
	public void draw(Graphics g) {
		int size = sizeX + (sizeX*(lifePoint));
		g.drawImage(img[lifePoint], x - size/2, y - size/2, size, size,
				Color.WHITE, panel);
		lifePoint++;
	}
	public boolean isLife() {
		if(lifePoint >= 3)
			life = false;
		return life;
	}
}
